package br.com.assemble.hermeserp.model.pojos.controle;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import br.com.assemble.hermeserp.ejb.annotation.DaoClass;
import br.com.assemble.hermeserp.model.BasePojo;
import br.com.assemble.hermeserp.model.pojos.pessoas.Empresa;
import br.com.assemble.hermeserp.model.pojos.pessoas.Pessoa;


/**
 * The persistent class for the USUARIOS database table.
 * 
 */
@Entity
@Table(name="USUARIOS")
@DaoClass(value="UsuarioDao", pu="hermes-pu")
public class Usuario extends BasePojo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="USU_IDENTIFY", unique=true, nullable=false)
	private BigInteger usuIdentify;

	@Column(name="USU_LOGIN", nullable=false, length=20)
	private String usuLogin;

	@Column(name="USU_SENHA", nullable=false, length=20)
	private String usuSenha;

	//bi-directional many-to-one association to LogAcesso
	@OneToMany(mappedBy="usuario")
	private List<LogAcesso> logAcessoCollection;

	//bi-directional one-to-one association to Pessoa
	@OneToOne(mappedBy="usuario", fetch=FetchType.LAZY)
	private Pessoa pessoa;

	//bi-directional many-to-one association to Empresa
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="EMP_IDENTIFY", nullable=false)
	private Empresa empresa;

    public Usuario() {
    }

	public BigInteger getUsuIdentify() {
		return this.usuIdentify;
	}

	public void setUsuIdentify(BigInteger usuIdentify) {
		this.usuIdentify = usuIdentify;
	}

	public String getUsuLogin() {
		return this.usuLogin;
	}

	public void setUsuLogin(String usuLogin) {
		this.usuLogin = usuLogin;
	}

	public String getUsuSenha() {
		return this.usuSenha;
	}

	public void setUsuSenha(String usuSenha) {
		this.usuSenha = usuSenha;
	}

	public List<LogAcesso> getLogAcessoCollection() {
		return this.logAcessoCollection;
	}

	public void setLogAcessoCollection(List<LogAcesso> logAcessoCollection) {
		this.logAcessoCollection = logAcessoCollection;
	}
	
	public Pessoa getPessoa() {
		return this.pessoa;
	}

	public void setPessoa(Pessoa pessoa) {
		this.pessoa = pessoa;
	}
	
	public Empresa getEmpresa() {
		return this.empresa;
	}

	public void setEmpresa(Empresa empresa) {
		this.empresa = empresa;
	}
	
}